package com.itany.shop.service;

import com.itany.shop.entity.Order;
import com.itany.shop.entity.User;
import com.itany.shop.exception.RequestParameterErrorException;
import com.itany.shop.exception.UserNotLoginException;
import com.itany.shop.vo.Cart;

import java.util.List;

/**
 * @author 石小俊
 */
public interface OrderService {

    /**
     * 生成订单,返回订单号
     * 多表保存操作
     * @param cart
     * @param user
     * @return
     */
    String createNo(Cart cart, User user) throws UserNotLoginException;

    /**
     * 查询我的订单
     * @param user
     * @return
     */
    List<Order> findMyOrders(User user) throws UserNotLoginException;

    /**
     * 查询订单明细
     * @param id
     * @return
     */
    Order findDetail(String id) throws RequestParameterErrorException;
}
